package com.xinchen.quartz.core.test.DataMapDemo;

import org.apache.log4j.Logger;
import org.quartz.*;

/**
 * Description：
 *
 * @author Xin Chen
 * @version 1.0
 * @date 2016/12/14 14:53
 * @see 2016/12/14 14:53 Created
 ****************************************/
public class DataMapJob implements Job {
    private static Logger logger = Logger.getLogger(DataMapJob.class);
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        JobKey key = jobExecutionContext.getJobDetail().getKey();
        JobDataMap dataMap = jobExecutionContext.getJobDetail().getJobDataMap();
        String param = dataMap.getString("param");
        int num = dataMap.getInt("num");
        logger.info("Hello World!  MyJob is executing.");
        System.out.println("Instance ["+key+"] of Job param ["+param+"] and num :"+num);
    }
}
